<?php if (isset($pager)): ?>
<div class="row-fluid">
    <div class="span12">
        <div class="box gradient">
            <div class="title">
                <h4>
                    <span>Danh sách các bài viết</span>
                </h4>
            </div>
            <div class="content noPad clearfix">
              <table cellpadding="0" cellspacing="0" border="0" class="responsive dynamicTable display table table-bordered" width="100%">
                <thead>
                  <tr>
                    <th>
                        <span>Hình</span>
                    </th>
                    <th>
                        <?php echo link_to_function('<span>Tên</span>', 'sort(\'name\', 1)') ?>
                    </th>
                    <th>
                        <?php echo link_to_function('<span>Lượt xem</span>', 'sort(\'views_count\', 1)') ?>
                    </th>
                    <th>
                        <span>Kích hoạt</span>
                    </th>
                    <th>
                        <?php echo link_to_function('<span>Ngày khởi tạo</span>', 'sort(\'created_at\', 1)') ?>
                    </th>
                    <th>
                      <?php echo "Thao Tác" ?>
                    </th>
                  </tr>
                </thead>
                <tbody>
				  <?php foreach ($pager->getResults() as $gallery): ?>
                    <tr>
                        <td style='text-align:center;'><?php echo ($gallery->picture)?"<img src='/images/true.gif' />":"<img src='/images/false.gif' />"  ?></td>
                        <td><?php echo $gallery->name ?></td>
                        <td style='text-align:center;'><?php echo $gallery->views_count ?></td>
                        <td style='text-align:center;'><?php echo ($gallery->is_active)?"<img src='/images/true.gif' />":"<img src='/images/false.gif' />"  ?></td>
                        <td style="text-align:center"><?php echo $gallery->created_at ?></td>
                        <td style="text-align:center">
                            <?php echo link_to('>>> Sửa', '@gallery_edit?gallery_id='.$gallery->gallery_id)."<br/>"?>
                            <?php echo link_to('>>> Xóa', '@gallery_delete?gallery_id='.$gallery->gallery_id, array('confirm' => 'Bạn muốn xóa mục này ?', 'absolute' => true))?>
                        </td>
                    </tr>
                  <?php endforeach ?>
                </tbody>
              </table>
			</div>
		</div>
	</div>
</div>
<?php endif ?>